#include <unistd.h>

/**
 * 编码转换
 *
 * @param to_charset
 * @param from_charset
 * @param inbuf
 * @param inlen
 * @param outbuf
 * @param outlen
 * @return
 */
extern int code_convert(char *to_charset, char *from_charset,
                        char *inbuf, int inlen, char *outbuf, int outlen);

/**
 * GB2312码转为UNICODE码
 *
 * @param inbuf
 * @param inlen
 * @param outbuf
 * @param outlen
 * @return
 */
extern int u2g(char *inbuf, int inlen, char *outbuf, int outlen);

/**
 * GB2312码转为UNICODE码
 *
 * @param inbuf
 * @param inlen
 * @param outbuf
 * @param outlen
 * @return
 */
extern int g2u(char *inbuf, size_t inlen, char *outbuf, size_t outlen);
